package com.cmccgz.udacs_landlord_webapp.base;

import com.cmccgz.udacs_landlord_webapp.bean.AccreditDetailBean;
import com.cmccgz.udacs_landlord_webapp.bean.AppInfo;
import com.cmccgz.udacs_landlord_webapp.bean.BuildingCountBean;
import com.cmccgz.udacs_landlord_webapp.bean.CardInfo;
import com.cmccgz.udacs_landlord_webapp.bean.CardMsg;
import com.cmccgz.udacs_landlord_webapp.bean.Device;
import com.cmccgz.udacs_landlord_webapp.bean.DeviceInfoBean;
import com.cmccgz.udacs_landlord_webapp.bean.FileResultBean;
import com.cmccgz.udacs_landlord_webapp.bean.HouseListDataBean;
import com.cmccgz.udacs_landlord_webapp.bean.HousePeopleBean;
import com.cmccgz.udacs_landlord_webapp.bean.LoginInfo;
import com.cmccgz.udacs_landlord_webapp.bean.Person;
import com.cmccgz.udacs_landlord_webapp.bean.PushRequestBean;
import com.cmccgz.udacs_landlord_webapp.bean.RecordDetail;
import com.cmccgz.udacs_landlord_webapp.bean.RenterBean;
import com.cmccgz.udacs_landlord_webapp.bean.RequestBean;
import com.cmccgz.udacs_landlord_webapp.bean.ResultBean;
import com.cmccgz.udacs_landlord_webapp.bean.UnlockRecord;
import com.cmccgz.udacs_landlord_webapp.bean.UserInfo;
import com.cmccgz.udacs_landlord_webapp.bean.WarningDetail;
import com.cmccgz.udacs_landlord_webapp.bean.WarningItem;

import java.util.List;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Url;
import rx.Observable;

/**
 * @author: Huang
 * @Descripion:
 * @date 2017/5/26 09:20
 */

public interface API {

    @POST("login")
    Observable<ResultBean<LoginInfo>> login(@Body RequestBean bean);

    @POST("get_house_list")
    Observable<ResultBean<List<HouseListDataBean>>> getHouseList(@Body RequestBean bean);

    @POST("get_house_detail")
    Observable<ResultBean<List<HousePeopleBean>>> getHouseDetail(@Body RequestBean bean);

    @POST("house_change")
    Observable<ResultBean> houseChange(@Body RequestBean bean);

    @POST("check_out")
    Observable<ResultBean> checkOut(@Body RequestBean bean);

    @POST("building_count_detail")
    Observable<ResultBean<List<BuildingCountBean>>> buildingCountDetail(@Body RequestBean bean);

    @POST("get_user_msg")
    Observable<ResultBean<UserInfo>> getUserInfo(@Body RequestBean request);

    @POST("pd_change")
    Observable<ResultBean> changePassword(@Body RequestBean request);

    @POST("get_device")
    Observable<ResultBean<List<Device>>> getDevices(@Body RequestBean request);

    @POST("open_door")
    Observable<ResultBean> openDoor(@Body RequestBean request);

    @POST("get_door_rec")
    Observable<ResultBean<List<UnlockRecord>>> getUnlockRecord(@Body RequestBean request);

    @POST("cmt_user_msg")
    Observable<ResultBean> changeUserInfo(@Body RequestBean request);

    @POST("get_user_list")
    Observable<ResultBean<List<RenterBean>>> getUserList(@Body RequestBean request);

    @POST("get_card_detail")
    Observable<ResultBean<CardMsg>> getCardDetail(@Body RequestBean requestBean);

    @POST("new_card")
    Observable<ResultBean<String>> newCard(@Body RequestBean requestBean);

    @POST("change_card")
    Observable<ResultBean<String>> changeCard(@Body RequestBean requestBean);

    @POST("delete_card")
    Observable<ResultBean<String>> deleteCard(@Body RequestBean requestBean);

    @POST("card_status_change")
    Observable<ResultBean<String>> cardStatusChange(@Body RequestBean requestBean);

    @POST("date_change")
    Observable<ResultBean<String>> dateChange(@Body RequestBean requestBean);

    @POST("rent_house")
    Observable<ResultBean> accreditCard(@Body RequestBean bean);

    @Multipart
    @POST("upload")
    Observable<FileResultBean> upload(@Part("signature") RequestBody signature, @Part("toUser") RequestBody toUser,
                                      @Part("type") RequestBody type, @Part("mediaDetail") RequestBody mediaDetail,
                                      @Part MultipartBody.Part file);

    @POST("card_status_change")
    Observable<ResultBean> changeCardState(@Body RequestBean bean);

    @POST("devices_sync")
    Observable<ResultBean<List<DeviceInfoBean>>> deviceSync(@Body RequestBean requestBean);

    @POST("get_sms")
    Observable<ResultBean> getSms(@Body RequestBean requestBean);

    @POST("reset_pd")
    Observable<ResultBean> resetPD(@Body RequestBean requestBean);

    @POST("get_request_detail")
    Observable<ResultBean<AccreditDetailBean>> getRequestDetail(@Body RequestBean requestBean);

    @POST("handle_visitor_request")
    Observable<ResultBean> handleVisitorRequest(@Body RequestBean requestBean);

    @POST("get_appinfo")
    Observable<ResultBean<AppInfo>> getAppInfo(@Body RequestBean requestBean);

    @POST("get_request_list")
    Observable<ResultBean<List<PushRequestBean>>> getRequestList(@Body RequestBean requestBean);

    @POST("devices_status")
    Observable<ResultBean<List<DeviceInfoBean>>> getDevicesStatus(@Body RequestBean requestBean);

    @POST("get_warning_list")
    Observable<ResultBean<List<WarningItem>>> getWarningList(@Body RequestBean requestBean);

    @POST("get_warning_detail")
    Observable<ResultBean<WarningDetail>> getWarningDetail(@Body RequestBean requestBean);

    @POST("create_warning")
    Observable<ResultBean> createWarning(@Body RequestBean requestBean);

    @POST("del_warning")
    Observable<ResultBean> deleWarning(@Body RequestBean requestBean);

    @POST("edit_warning")
    Observable<ResultBean> editWarning(@Body RequestBean requestBean);

    @POST("deal_warning")
    Observable<ResultBean> dealWarnig(@Body RequestBean requestBean);

    @POST("confirm_warning")
    Observable<ResultBean> confirmWarning(@Body RequestBean requestBean);

    @POST("reject_warning")
    Observable<ResultBean> rejectWarning(@Body RequestBean requestBean);

    @POST("get_rec_detail")
    Observable<ResultBean<RecordDetail>> getRecDetail(@Body RequestBean requestBean);

    @GET
    Observable<ResponseBody> downFile(@Url String url);

    @POST("get_renter_list")
    Observable<ResultBean<List<Person>>> getRenterList(@Body RequestBean requestBean);

    @POST("add_renter")
    Observable<ResultBean> addRenter(@Body RequestBean requestBean);

    @POST("get_card_no")
    Observable<ResultBean<CardInfo>> getCardNo(@Body RequestBean requestBean);

    @POST("add_card")
    Observable<ResultBean> addCard(@Body RequestBean requestBean);

    @POST("app_accredit")
    Observable<ResultBean> appAccredit(@Body RequestBean requestBean);
}
